cmake_minimum_required(VERSION 3.10)

find_package(Boost COMPONENTS program_options date_time)

include_directories($ENV{DM2016_DEV}/tinyxml/inc ${Boost_INCLUDE_DIRS})
include_directories($ENV{DM2016_DEV})

link_directories(${LIBRARY_OUTPUT_PATH})

aux_source_directory(src SRC)

add_executable(sessiontool ${SRC})

DB_SELECT(sessiontool)

if( Boost_FOUND )
    if( WIN32 )
        target_link_libraries(sessiontool session scada oslog osmsg dmos osdb options string misc env tinyxml json ${Boost_LIBRARIES})
    else()
        target_link_libraries(sessiontool session scada oslog osmsg dmos osdb options string misc env tinyxml json ${Boost_LIBRARIES} rt)
    endif()
else()
    if( WIN32 )
        target_link_libraries(sessiontool session scada oslog osmsg dmos osdb options string misc env tinyxml json boost_program_options)
    else()
        target_link_libraries(sessiontool session scada oslog osmsg dmos osdb options string misc env tinyxml json boost_program_options rt)
    endif()
endif()